package com.inspinia.base.mq.rabbitmq.config;

import java.util.ResourceBundle;

/**
 * rabbitmq的配置项
 * Created by heshu on 2016/3/6.
 */
public class RabbitConfig {

    /**
     * properties的配置数据
     */
    public static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("rabbitMq");

    public static String getString(String key) {
        return RESOURCE_BUNDLE.getString(key);
    }


    public final static String HOST = getString("spring.rabbitmq.host");
    public final static int PORT = Integer.parseInt(getString("spring.rabbitmq.port"));
    public final static String USERNAME = getString("spring.rabbitmq.username");
    public final static String PASSWORD = getString("spring.rabbitmq.password");
    public final static String VHOST = getString("spring.rabbitmq.vhost");
    public final static String QUEUE_EXCHANGE = getString("spring.rabbitmq.queue.exchange");
    public final static String DELAY_QUEUE_EXCHANGE = getString("spring.rabbitmq.queue.delay.exchange");
    public final static int QOS = Integer.parseInt(getString("spring.rabbitmq.queue.qos"));
    public final static String QUEUE = getString("spring.rabbitmq.queue_key");
    public final static String ROUTING_KEY = getString("spring.rabbitmq.routingKey");
    public final static boolean CONFIRMS = Boolean.parseBoolean(getString("spring.rabbitmq.publisher-confirms"));
    public final static boolean RETURNS = Boolean.parseBoolean(getString("spring.rabbitmq.publisher-returns"));
    public final static boolean MANDATORY = Boolean.parseBoolean(getString("spring.rabbitmq.template.mandatory"));

}
